package com.cleaningcloud.erp.domain;

import com.cleaningcloud.common.core.annotation.Excel;
import com.cleaningcloud.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 调拨对象 erp_ware_allocate
 *
 * @author cleaningcloud
 * @date 2024-10-08
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ErpWareAllocate extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 调拨ID
     */
    private Long wareAllocateId;

    /**
     * 调拨单号
     */
    @Excel(name = "调拨单号", sort = 1)
    private String wareAllocateOdd;

    /**
     * 调出仓库ID
     */
    private Long wareOutId;

    /**
     * 调出人
     */
    private Long wareOutPerson;

    /**
     * 调入仓库ID
     */
    private Long wareInId;

    /**
     * 调入人
     */
    private Long wareInPerson;

    /**
     * 调拨时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "调拨日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 7)
    private Date wareAllocateDate;

    /**
     * 创建人ID
     */
    private Long createId;

    /**
     * 创建人名称
     */
    @Excel(name = "创建人", sort = 8)
    private String createName;

    /**
     * 备注是否关闭
     */
    private String flag;

    /**
     * 审批状态(0待审批1已通过2被驳回)
     */
    @Excel(name = "审批状态", sort = 9, readConverterExp = "-1草稿,0=待审批,1=已通过,2=被驳回")
    private Integer approveStatus;

    /**
     * 审批人ID
     */
    private Long approveId;

    /**
     * 审批人名称
     */
    @Excel(name = "审批人", sort = 10)
    private String approveName;

    /**
     * 审批时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 11)
    private Date approveTime;

    /**
     * 驳回时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date rejectTime;

    /**
     * 驳回原因
     */
    private String rejectReason;

    // 批量导出ids
    private String exportIds;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("wareAllocateId", getWareAllocateId())
                .append("wareAllocateOdd", getWareAllocateOdd())
                .append("wareOutId", getWareOutId())
                .append("wareOutPerson", getWareOutPerson())
                .append("wareInId", getWareInId())
                .append("wareInPerson", getWareInPerson())
                .append("wareAllocateDate", getWareAllocateDate())
                .append("remark", getRemark())
                .append("createId", getCreateId())
                .append("createName", getCreateName())
                .append("createTime", getCreateTime())
                .append("flag", getFlag())
                .append("approveStatus", getApproveStatus())
                .append("approveId", getApproveId())
                .append("approveName", getApproveName())
                .append("approveTime", getApproveTime())
                .append("rejectTime", getRejectTime())
                .append("rejectReason", getRejectReason())
                .toString();
    }
}
